package com.dianping.cat.home.exception.transform;
import com.dianping.cat.home.exception.entity.ExceptionExclude;
import com.dianping.cat.home.exception.entity.ExceptionLimit;
import com.dianping.cat.home.exception.entity.ExceptionRuleConfig;
import java.util.ArrayList;
import java.util.List;

public class DefaultLinker implements ILinker {
  private boolean m_deferrable;

  public DefaultLinker(boolean deferrable) {
/* 12 */     this.m_deferedJobs = new ArrayList();


/* 15 */     this.m_deferrable = deferrable;
  }
  private List<Runnable> m_deferedJobs;
  public void finish() {
/* 19 */     for (Runnable job : this.m_deferedJobs) {
/* 20 */       job.run();
    }
  }


  public boolean onExceptionExclude(final ExceptionRuleConfig parent, final ExceptionExclude exceptionExclude) {
/* 26 */     if (this.m_deferrable) {
/* 27 */       this.m_deferedJobs.add(new Runnable()
          {
            public void run() {
/* 30 */               parent.addExceptionExclude(exceptionExclude);
            }
          });
    } else {
/* 34 */       parent.addExceptionExclude(exceptionExclude);
    }

/* 37 */     return true;
  }


  public boolean onExceptionLimit(final ExceptionRuleConfig parent, final ExceptionLimit exceptionLimit) {
/* 42 */     if (this.m_deferrable) {
/* 43 */       this.m_deferedJobs.add(new Runnable()
          {
            public void run() {
/* 46 */               parent.addExceptionLimit(exceptionLimit);
            }
          });
    } else {
/* 50 */       parent.addExceptionLimit(exceptionLimit);
    }

/* 53 */     return true;
  }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/exception/transform/DefaultLinker.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */